package cn.stylefeng.guns.sys.modular.system.mapper;

import cn.stylefeng.guns.sys.modular.system.entity.ZxChengben;
import cn.stylefeng.guns.sys.modular.system.model.params.ZxChengbenParam;
import cn.stylefeng.guns.sys.modular.system.model.result.ZxChengbenResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * bty_zx_demo Mapper 接口
 * </p>
 *
 * @author jiangge
 * @since 2020-11-02
 */
public interface ZxChengbenMapper extends BaseMapper<ZxChengben> {

    /**
     * 获取列表
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    List<ZxChengbenResult> customList(@Param("paramCondition") ZxChengbenParam paramCondition);

    /**
     * 获取map列表
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") ZxChengbenParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    Page<ZxChengbenResult> customPageList(@Param("page") Page page, @Param("paramCondition") ZxChengbenParam paramCondition);

    Page<ZxChengbenResult> customChengbenAndMingXiPageList(@Param("page") Page page, @Param("paramCondition") ZxChengbenParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") ZxChengbenParam paramCondition);

    List<ZxChengbenResult> selectListByBtyZxMdzxId(@Param("btyZxMdzxId") Long btyZxMdzxId);

    BigDecimal getSumOfChengBen(@Param("btyZxMdzxId") Long btyZxMdzxId);

    List<ZxChengbenResult> listChengbenInfoBymdzx(@Param("btyZxMdzxId") Long btyZxMdzxId);

    boolean batchAdd(@Param("list") List<ZxChengben> list);

    Integer selectCountByHuoPinId(@Param("param") ZxChengbenParam btyZxHuopinId);

    Integer selectCountByBtyZxMdzxId(@Param("param") ZxChengbenParam zxChengbenParam);

    /**
     * 更新对应成本记录
     * @param param
     */
    void updateByParam(@Param("param") ZxChengbenParam param);

    int isExist(@Param("param") ZxChengbenParam param);

    IPage listBh(@Param("page") Page page, @Param("paramCondition") ZxChengbenParam paramCondition);

    void updateChengben(@Param("param") ZxChengben zxChengben);
}
